﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class testPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public static string getNextPaddingNumber(char pad, string prefix, string suffix, int lastNumber, int length)
    {
        string val =prefix + lastNumber.ToString().PadLeft(length, pad) + suffix;
        return val;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string prefix = TextBox2.Text.Trim();
        int lastNumber = Convert.ToInt32(TextBox3.Text);
        int width = Convert.ToInt32(TextBox4.Text);
        TextBox1.Text = getNextPaddingNumber('0', prefix, "", lastNumber, width);
    }
}